from django.db import models
from user.models import SysUser


# Create your models here.
class StudentScore(models.Model):
    id = models.AutoField(primary_key=True)
    student_id = models.CharField(max_length=50, verbose_name="学号")
    student_name = models.CharField(max_length=100, verbose_name="学生姓名")
    subject = models.CharField(max_length=100, verbose_name="科目")
    score = models.DecimalField(max_digits=5, decimal_places=2, verbose_name="成绩")
    semester = models.CharField(max_length=50, verbose_name="学期")
    exam_type = models.CharField(max_length=50, verbose_name="考试类型")
    exam_date = models.DateField(verbose_name="考试日期")
    remark = models.CharField(max_length=500, null=True, blank=True, verbose_name="备注")
    create_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间")
    update_time = models.DateTimeField(auto_now=True, verbose_name="修改时间")

    class Meta:
        db_table = "student_score"
        ordering = ['-exam_date', 'student_id']
